package com.xujie.sportsmeeting.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 检录批次实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("checkin_session")
public class CheckinSession implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 检录批次ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 比赛项目ID
     */
    @NotNull(message = "比赛项目ID不能为空")
    @TableField("event_id")
    private Long eventId;

    /**
     * 检录批次名称
     */
    @NotBlank(message = "检录批次名称不能为空")
    @TableField("session_name")
    private String sessionName;

    /**
     * 检录开始时间
     */
    @NotNull(message = "检录开始时间不能为空")
    @TableField("checkin_start_time")
    private LocalDateTime checkinStartTime;

    /**
     * 检录结束时间
     */
    @NotNull(message = "检录结束时间不能为空")
    @TableField("checkin_end_time")
    private LocalDateTime checkinEndTime;

    /**
     * 检录地点
     */
    @TableField("checkin_location")
    private String checkinLocation;

    /**
     * 负责人
     */
    @TableField("responsible_person")
    private String responsiblePerson;

    /**
     * 状态 0-关闭 1-开启
     */
    @TableField("status")
    private Integer status;

    /**
     * 应检录人数
     */
    @TableField("total_athletes")
    private Integer totalAthletes;

    /**
     * 已检录人数
     */
    @TableField("checked_in_count")
    private Integer checkedInCount;

    /**
     * 缺席人数
     */
    @TableField("absent_count")
    private Integer absentCount;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
